package cn.linweijian.kafka.producerdemo.common;

/**
 * Description: 返回结果
 * <p>
 * Created by linweijian on 2018/6/4 14:06
 */
public class ResponseResult {
    //响应状态
    String push_result;
    //响应信息
    String msg_info;

    public String getPush_result() {
        return push_result;
    }

    public void setPush_result(String push_result) {
        this.push_result = push_result;
    }

    public String getMsg_info() {
        return msg_info;
    }

    public void setMsg_info(String msg_info) {
        this.msg_info = msg_info;
    }

    /**
     * 返回成功
     *
     * @param msg_info
     * @return cn.linweijian.kafka.producerdemo.common.ResponseResult
     * @author linweijian
     * @date 2018/6/4 14:14
     **/
    public static ResponseResult success(String msg_info) {
        ResponseResult r = new ResponseResult();
        r.setMsg_info(msg_info);
        r.setPush_result("SUCCESS");
        return r;

    }

    /**
     * 返回失败
     *
     * @param error
     * @return cn.linweijian.kafka.producerdemo.common.ResponseResult
     * @author linweijian
     * @date 2018/6/4 14:14
     **/
    public static ResponseResult error(String error) {
        ResponseResult r = new ResponseResult();
        r.setMsg_info(error);
        r.setPush_result("ERROR");
        return r;
    }
}
